lagranges mean value theorem application of derivatives